﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace _0517病例系统
{
    public partial class chaxun : Form
    {
        public chaxun()
        {
            InitializeComponent();
        }

        private static string id;

        public static string Id
        {
            get { return chaxun.id; }
            set { chaxun.id = value; }
        }



        private void chaxun_Load(object sender, EventArgs e)
        {
            string strSql = "";
            DataSet ds;
            strSql = "select * from Newss where 1=1";
            DataAccess data = new DataAccess();
            data.dataCon();
            ds = data.getDataset(strSql);
            this.dataGridView1.DataSource = ds.Tables["Table"];
        }

         public static string  b, n, p, y;
         private void button1_Click(object sender, EventArgs e)
        {
           
            if (dataGridView1.SelectedRows.Count > 0)
            {
                b = dataGridView1.CurrentRow.Cells["ID"].Value.ToString();
                n = dataGridView1.CurrentRow.Cells["RName"].Value.ToString();
                p = dataGridView1.CurrentRow.Cells["Phone"].Value.ToString();
                y = dataGridView1.CurrentRow.Cells["Yearss"].Value.ToString();
                this.Close();
                _0517.frmSer ser = new _0517.frmSer();
                ser.Show();
            }

            
        }

         private void button2_Click(object sender, EventArgs e)
         {
             this.Hide();
         }
    }
}
